#include<set>
#include<iostream>
using namespace std;
struct st{//自定义排序
    bool operator()(int a,int b)const{
        return a%8>b%8;
    }
};
void putData(set<int,st> s,string str){
    cout<<str;
    for(auto val:s)
        cout<<val<<" ";
    cout<<endl;
}
void getData(set<int,st>&s,int n,int front,int rear){
    for(int i=0;i<n;i++)
        s.insert(rand()%(rear-front+1)+front);//插入元素
}
int main(){
    set<int,st>s;
    getData(s,10,-10,10);
    putData(s,"原始数据：");
    auto air=s.find(5);//查找
    if(air!=s.end()){
        cout<<"5的下标为："<<*air<<endl;
        s.erase(air);
        putData(s,"数据删除：");
    }
    return 0;
}